/* eslint-disable no-underscore-dangle */
const { createClient } = require('redis');

const client = createClient({
  socket: {
    host: process.env.REDIS_HOST,
    port: process.env.REDIS_PORT,
  },
  password: process.env.REDIS_PASSWORD,
  username: process.env.REDIS_USERNAME,
});

client.on('connection', () => {
  console.log({
    message: 'connetion successful',
  });
});

client.on('error', (err) => {
  console.error('Redis Client Error', err);
});

module.exports = client;
